﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IList<PearTunes.Model.Track>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ListTracks
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>A szerveren található számok listája</h2>
    <table>
        <tr><th>Törlés</th><th>Azonosító</th><th>Előadó</th><th>Album</th><th>Cím</th></tr>
        <%
        foreach (PearTunes.Model.Track t in Model)
        {%>
            <tr>
            <td>
             <%=Html.ActionLink("Törlés", "DeleteTrack", new { id = t.TrackId.ToString() })%>
            </td>
               <td><%=Html.Label(t.TrackId.ToString()) %></td>
               <td><%=Html.Label(t.Artist) %></td>
               <td><%=Html.Label((t.Albums != null && t.Albums.Count() > 0 && t.Albums.First().Title != null) ? t.Albums.First().Title : "n/a") %></td>
               <td><%=Html.Label(t.Title) %></td>
            </tr>
            
    <%  }  %>
    </table>
</asp:Content>
